package com.disapand.mall.exception;

import com.disapand.mall.handle.ResponseStatus;
import lombok.Getter;

/**
 * @author disapand
 */
@Getter
public class CustomException extends RuntimeException {

    /**
     * 异常状态状态码
     */
    private Integer code;
    /**
     * 异常状态提示信息
     */
    private String message;

    public CustomException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public CustomException(ResponseStatus responseStatus) {
        this.code = responseStatus.getCode();
        this.message = responseStatus.getMessage();
    }
}
